<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/IncludeTop.jsp" %> 
<html>
<head>
<base href="<%=basePath%>" >
<title>滚球</title>
</head>
<body>
<table width="100%" border="1">
		<tr>
			<td colspan="9" width="100%" align="right">
				<form action="common/listGunqiuEvent.do">
				<select name="leagueName" onchange="javaScript:document.getElementsByTagName('form')[0].submit()">
					<option value="all">全部赛区</option>
					<c:forEach var="event" items="${requestScope.events}">
						<c:if test="${empty leagueid || leagueid != event.comp.league.id}">
							<option value="<c:out value="${event.comp.league.id}" />"  <c:if test="${requestScope.leagueId == event.comp.league.id}">selected</c:if> >
								<c:out value="${event.comp.league.name_zh}" />
							</option>
						</c:if>
						<c:set var="leagueid" value="${event.comp.league.id}"></c:set>
					</c:forEach>
				</select>
				</form>
			</td>
		</tr>
		
		<tr><td colspan="9" width="100%" align="center">足球赛事综合列表</td></tr>
		 
			<tr>
				<th align="center" width="8%">时间</th>
				<th align="center" width="15%">主客队伍</th>
				<th align="center" width="7%">比分</th>
				<th align="center" width="15%">让球</th>
				<th align="center" width="25%">大/小</th>
				<th align="center" width="15%">让球(上半场)</th>
				<th align="center" width="15%">大/小(上半场)</th>
 			</tr>
 			
		<c:forEach var="event" items="${events}">
			<c:if test="${empty name || event.comp.league.name_zh != name}">
			<tr>
				<td colspan="5" align="left"><c:out value="${event.comp.league.name_zh}" /></td>
			</tr>
			</c:if>	
			<c:set var="name" value="${event.comp.league.name_zh}" />
			<tr id="<c:out value="${event.id}"/>">
				<td align="center"><fmt:formatDate value="${event.comp.time}" type="both" /></td>
				<td>
					<c:out value="${event.comp.home.name_zh}"></c:out>[主]
					<br/>
					<c:out value="${event.comp.road.name_zh}"></c:out>
				</td>
				<td align="center">
					<c:out value="${event.comp.nowResult }" />
				</td>
				<td align="right">
				<table>
					<tr>
						<td align="right">
							<c:if test="${event.rangqiu.who2who eq '主让客'}">
								<font color="red"><c:out value="${event.rangqiu.pankou}" /></font>&nbsp;
							</c:if>
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=rq_home&gunqiu=true" >
								<c:out value="${event.rangqiu.home}" />
							</a>
						</td>
					</tr>
					<tr>
						<td align="right">
							<c:if test="${event.rangqiu.who2who eq '客让主'}">
								<font color="red"><c:out value="${event.rangqiu.pankou}" /></font>&nbsp;
							</c:if>
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=rq_road&gunqiu=true" >
								<c:out value="${event.rangqiu.road}" />&nbsp;
							</a>
						</td>
					</tr>
				</table>
				</td>
				<td align="right">
				<table>
					<tr>
						<td align="right">
							大
							<c:out value="${event.daxiao.pankou}" />&nbsp;
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=dx_home&gunqiu=true" >
								<c:out value="${event.daxiao.home}"></c:out> 
							</a>
						</td>
					</tr>
					<tr>
						<td align="right">
							小 <c:out value="${event.daxiao.pankou}" />&nbsp;
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=dx_road" >
								<c:out value="${event.daxiao.road}"></c:out> 
							</a>
						</td>
					</tr>
				</table>
				</td>
				
				
				<td align="right">
				<table>
					<tr>
						<td align="right">
						<c:if test="${event.comp.id ne displayHalfFlag}">
							
							<c:if test="${event.rangqiuHalf.who2who eq '主让客'}">
								<font color="red"><c:out value="${event.rangqiuHalf.pankou}" /></font>&nbsp;
							</c:if>
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=rq_half_home&gunqiu=true" >
								<c:out value="${event.rangqiuHalf.home}" />
							</a>
						</c:if>
						</td>
					</tr>
					<tr>
						<td align="right">
						<c:if test="${event.comp.id ne displayHalfFlag}">
							<c:if test="${event.rangqiuHalf.who2who eq '客让主'}">
								<font color="red"><c:out value="${event.rangqiuHalf.pankou}" /></font>&nbsp;
							</c:if>
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=rq_half_road&gunqiu=true" >
								<c:out value="${event.rangqiuHalf.road}" />&nbsp;
							</a>
						</c:if>
						</td>
					</tr>
				</table>
				</td>
				<td align="right">
				<table>
					<tr>
						<td align="right">
						<c:if test="${event.comp.id ne displayHalfFlag}">
							大
							<c:out value="${event.daxiaoHalf.pankou}" />&nbsp;
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=dx_half_home&gunqiu=true" >
								<c:out value="${event.daxiaoHalf.home}"></c:out> 
							</a>
						</c:if>
						</td>
					</tr>
					<tr>
						<td align="right">
						<c:if test="${event.comp.id ne displayHalfFlag}">
							小 <c:out value="${event.daxiaoHalf.pankou}" />&nbsp;
							<a href="user/tobet.do?eventid=<c:out value="${event.id}" />&oddtype=dx_half_road" >
								<c:out value="${event.daxiaoHalf.road}"></c:out> 
							</a>
						</c:if>
						</td>
					</tr>
				</table>
				</td>
				
			</tr>
			<c:set var="displayHalfFlag" value="${event.comp.id}" ></c:set>
		</c:forEach>
	</table>
	<table width="97%">
		<tr>
			<td width="100%" align="right" >
				<form action="common/listDanshiEvent.do">
					跳转到第
					<select name="page" onchange="javaScript:document.getElementsByTagName('form')[1].submit()">
						<c:forEach var="page" begin="1" end="${requestScope.count + 1}" step="1">
							<option value="<c:out value="${page}" />"><c:out value="${page}" /></option>&nbsp;
						</c:forEach>	
					</select>
					页
				</form>
			</td>
		</tr>
	</table>
</body>
</html>